package UserUI;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import vo.TeacherVO;

public class TeacherInfo extends JPanel {
	protected JLabel namelbl;
	protected JLabel numlbl;
	protected JLabel deplbl;
	protected JLabel chalbl;
	
	protected JTextField nameText;
	protected JTextField numText;
	protected JTextField depText;
	protected JTextField chaText;
	/**
	 * Create the panel.
	 */
	public TeacherInfo(TeacherVO aim) {
		this.setSize(768,580);
		this.setVisible(true);
		this.setLayout(null);
		setOpaque(false);
		namelbl = new JLabel("\u59D3\u540D");
		namelbl.setBounds(37, 34, 72, 18);
		add(namelbl);
		
		nameText = new JTextField(aim.teacherName);
		nameText.setBounds(0, 52, 147, 24);
		add(nameText);
		nameText.setEditable(false);
		nameText.setColumns(10);
		
		numlbl = new JLabel("\u5DE5\u53F7");
		numlbl.setBounds(261, 34, 72, 18);
		add(numlbl);
		
		numText = new JTextField(aim.ID);
		numText.setBounds(224, 52, 147, 24);
		add(numText);
		numText.setEditable(false);
		numText.setColumns(10);
		
		deplbl = new JLabel("\u9662\u7CFB");
		deplbl.setBounds(37, 130, 92, 18);
		add(deplbl);
		
		depText = new JTextField(aim.department);
		depText.setBounds(0, 147, 147, 24);
		add(depText);
		depText.setEditable(false);
		depText.setColumns(10);
		
		chalbl = new JLabel("\u6743\u9650");
		chalbl.setBounds(261, 130, 72, 18);
		add(chalbl);
		
		chaText = new JTextField(aim.character);
		chaText.setBounds(224, 147, 147, 24);
		add(chaText);
		chaText.setEditable(false);
		chaText.setColumns(10);
		this.setOpaque(false);
		this.repaint();
	}

	public void showTeacher(TeacherVO aim){
		nameText.setText(aim.teacherName);
		numText.setText(aim.ID);
		depText.setText(aim.department);
		chaText.setText(aim.character);
		this.repaint();
	}
}
